<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			// http拦截器
			this.httpInterceptor()
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods:{
			// HTTP拦截器：url、param、token等
			httpInterceptor() {
				uni.addInterceptor('request', {
					success(res) {
						if (res.statusCode != 200) {
							return false; // 后端响应错误结果，阻止后续业务逻辑执行
						}
					},
					returnValue(promise) {
						promise.then((res) => {
							res.data = "你要修改的值。"
						})
					}
				})
			}
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
